package com.taotao.common.utils;

import java.util.HashMap;
import java.util.Map;

public class SystemConst {

	public static final String USER = "pactl";
	public static final Long CC_OPERATOR_STATUS_0 = 0l;
	public static final int PAGE_START = 1;
	public static final int PAGE_ROWS = 100;
	public static final int IMAG_WIDE_SIZE = 150;

	public static final String UPDATE = "update";
	public static final String INSERT = "insert";

	public static final String DIFF_CLASS = "class";
	public static final String DIFF_FIELD = "field";

	/**
	 * 一次性
	 */
	public static final String ONE_TIME = "onetime";

	/**
	 * 共享
	 */
	public static final String SHARING = "sharing";

	/**
	 * false
	 */
	public static final String DISABLE_FLAG_0 = "0";
	/**
	 * true
	 */
	public static final String DISABLE_FLAG_1 = "1";

	/**
	 * 制单，创建
	 */
	public static final String OPERATION_DO = "OPERATION_DO";
	public static final String OPERATION_DO_NAME = "制单";

	/**
	 * 代理预审，提交预审
	 */
	public static final String OPERATION_AGENT_TRIAL = "OPERATION_AGENT_TRIAL";
	public static final String OPERATION_AGENT_TRIAL_LINK_NAME = "预审";
	public static final String OPERATION_AGENT_TRIAL_NAME = "提交预审";
	public static final String OPERATION_AGENT_TRIAL_ADD_LOCALE_NAME = "修改现场检查";
	public static final String OPERATION_AGENT_TRIAL_COMMIT_NAME = "提交预审";
	public static final String OPERATION_AGENT_TRIAL_BACK_NAME = "撤回预审";
	public static final String OPERATION_AGENT_TRIAL_ADD_OPEN_NAME = "添加开箱检查标识";
	public static final String OPERATION_AGENT_TRIAL_DELETE_OPEN_NAME = "删除开箱检查标识";
	public static final String OPERATION_AGENT_TRIAL_APPROACH_FLAG = "进场";

	/**
	 * pactl预审
	 */
	public static final String OPERATION_PACTL_TRIAL = "OPERATION_PACTL_TRIAL";
	public static final String OPERATION_PACTL_TRIAL_LINK_NAME = "PACTL预审";
	public static final String OPERATION_PACTL_TRIAL_NAME = "预审通过";
	public static final String OPERATION_PACTL_TRIAL_PASS_NAME = "预审通过";
	public static final String OPERATION_PACTL_TRIAL_BACK_NAME = "预审退回";
	public static final String OPERATION_PACTL_TRIAL_LOCAL_CHECK_PASS = "现场检查通过";
	public static final String OPERATION_PACTL_TRIAL_LOCAL_CHECK_REJECT = "现场检查退回";
	public static final String OPERATION_PACTL_TRIAL_LOCAL_CHECK = "现场检查";
	public static final String OPERATION_PACTL_TRIAL_LOCAL_RECHECK = "现场复检";

	/**
	 * 安检前
	 */
	public static final String OPERATION_BEFORE_CHECK = "OPERATION_PACTL_BEFORE_CHECK";
	public static final String OPERATION_BEFORE_CHECK_LINK_NAME = "安检前";
	public static final String OPERATION_BEFORE_CHECK_NAME = "安检前检查";
	public static final String OPERATION_BEFORE_CHECK_OPEN_PASS_NAME = "开箱检查通过";
	public static final String OPERATION_BEFORE_CHECK_OPEN_NO_PASS_NAME = "开箱检查未通过";
	public static final String OPERATION_BEFORE_CHECK_REBOOK_NAME = "接收正本";
	public static final String OPERATION_BEFORE_CHECK_MOVE_IN = "移入现场检查";
	public static final String OPERATION_BEFORE_CHECK_MOVE_OUT = "移出现场检查";
	public static final String OPERATION_BEFORE_CHECK_APPROACH_FLAG_IN = "进场";
	public static final String OPERATION_BEFORE_CHECK_APPROACH_FLAG_OUT = "出场";

	/**
	 * 安检
	 */
	public static final String OPERATION_CHECK = "OPERATION_CHECK";
	public static final String OPERATION_CHECK_LINK_NAME = "安检";
	public static final String OPERATION_CHECK_NAME = "安检";
	public static final String OPERATION_CHECK_ALLOW_NAME = "开始安检";
	public static final String OPERATION_CHECK_START_NAME = "开始安检";
	public static final String OPERATION_CHECK_PASS_NAME = "安检通过";
	public static final String OPERATION_CHECK_HOLD_NAME = "安检通过";
	public static final String OPERATION_CHECK_A_FLAG_CANCEL = "安检注销";

	/**
	 * 收单
	 */
	public static final String OPERATION_RECEIVING = "OPERATION_RECEIVING";
	public static final String OPERATION_RECEIVING_LINK_NAME = "收单";
	public static final String OPERATION_RECEIVING_NAME = "收单";
	public static final String OPERATION_RECEIVING_PASS_NAME = "收单完成";
	public static final String OPERATION_RECEIVING_NO_PASS_NAME = "收单未通过";
	public static final String OPERATION_RECEIVING_CLEAN = "清除安检状态";
	public static final String OPERATION_RECEIVING_ELE_TO_NOELE = "电子运单改非电子运单";
	public static final String OPERATION_RECEIVING_NOELE_TO_ELE = "非电子运单改电子运单";
	public static final String OPERATION_RECEIVING_RETURN_BILL = "退单";
	public static final String OPERATION_RECEIVING_RETURN_BILL_CHECK = "安保部门退单";
	public static final String OPERATION_RECEIVING_CANCEL_WAYBILL = "运单无效";

	/**
	 * 汪碧辉添加字段
	 */
	public static final String OPERATION_SOURCE_1 = "运单审核";
	public static final String OPERATION_SOURCE_2 = "共享引用";
	public static final String OPERATION_SOURCE_3 = "代理上传";
	public static final String OPERATION_SOURCE_TYPE_1 = "其他";
	public static final String OPERATION_SOURCE_TYPE_2 = "证书";
	public static final String OPERATION_SOURCE_TYPE_3 = "磁检证书";
	public static final String OPERATION_RECEIVING_CHANGE_WAYBILL_STATUS_OK = "无效运单标记为有效运单";
	public static final String OPERATION_RECEIVING_CHANGE_WAYBILL_STATUS_INVALID = "有效运单标记为无效运单";
	public static final String OPERATION_RECEIVING_OTHEROPERATION = "OPERATION_RECEIVING_OTHER";
	public static final String OPERATION_RECEIVING_RESTORAGE = "重新入库";
	public static final String OPERATION_RECEIVING_CANCEL_RESTORAGE = "取消重新入库";

	/**
	 * 数据修改申请
	 */
	public static final String OPERATION_DATA_UPDATE = "OPERATION_DATA_UPDATE";

	/**
	 * 操作类型
	 */
	public static final String OPERATION_CREATE = "CREATE";
	public static final String OPERATION_UPDATE = "UPDATE";
	public static final String OPERATION_DELETE = "DELETE";

	/**
	 * 默认版本
	 */
	public static final long DEFAULT_VERSION = 5000;
	public static final String VERSION_NONE = "none";
	public static final String VERSION_SUCCESS = "success";
	public static final String VERSION_ERROR = "error";

	/**
	 * 证书检查类型
	 */
	public static final String BOOK_CHECK_TYPE_BOOK = "book";
	public static final String BOOK_CHECK_TYPE_ELECTRIC = "electric";
	public static final String BOOK_CHECK_TYPE_OTHER = "other";

	/**
	 * 差异审核结果
	 */
	public static final String CHANGE_NONE = "none";
	public static final String CHANGE_ERROR = "error";
	public static final String CHANGE_SUCCESS = "success";
	public static final String CHANGE_SAVE = "save";
	public static final String CHANGE_ROLLABCK = "rollabck";

	/**
	 * 差异来源
	 */
	public static final String DIFF_SOURCE_MAIL = "mail";
	public static final String DIFF_SOURCE_MANUAL = "manual";

	public static class ResultCode {
		public static final Integer RESULT_SUCCESS = 1000;// 成功
		public static final Integer USER_IS_NULL = 4001;// 用户为空
		public static final Integer USER_IS_BLANK = 4002;// 用户名称为空
		public static final Integer USER_IS_TOO_LONG = 4003;// 用户名太长
		public static final Integer USER_INFO_INIT_ERROR = 4004;// 用户信息初始化出错
		public static final Integer USER_ISNOT_EXISTS = 4005;// 用户不存在

		public static final Integer USER_PSWORD_IS_ERROR = 4100;// 用户密码错误
	}

	/**
	 * 邮箱组件
	 */
	public static final String QUARTZ_MAIL_RECEIVE_TYPE_DID = "BOOKS"; // 获取邮件ID查询条件
	public static final String QUARTZ_EMAIL_TYPE_1 = "1"; // --证书共享收件箱
	public static final String QUARTZ_EMAIL_TYPE_2 = "2"; // --证书共享发件箱
	public static final String QUARTZ_EMAIL_DEL_STATUS = "0"; // 获取邮件ID查询条件
	public static final String QUARTZ_EMAIL_SEND_HTML_TITLE = "<title>上传共享证书反馈</title>";// 发送邮件内容html标题
	public static final String QUARTZ_EMAIL_SEND_MSG_SUBJET = "上传共享证书反馈";// 发送邮件内容主题
	public static final String QUARTZ_EMAIL_SEND_MAIL_ATTACHMENT = "附件名";// 附件名
	public static final String QUARTZ_EMAIL_SEND_FILE_ID = "文件编号";// 文件编号
	public static final String QUARTZ_EMAIL_SEND_MSG_RESULT = "上传共享证书结果";// 上传共享证书结果
	public static final String QUARTZ_EMAIL_SEND_ATTACHMENT_INFO = "附件信息";// 上传共享证书结果

	public static Map<String, Object> excelTransDict(String dictType) {
		if (Utils.isEmpty(dictType)) {
			return null;
		}
		HashMap<String, Object> p_map = new HashMap<>();
		if ("shipper".equalsIgnoreCase(dictType)) {
			// 收发货人类型
			HashMap<String, String> scType = new HashMap<>();
			scType.put("0", "收货人");
			scType.put("1", "发货人");
			scType.put("2", "通知人");
			scType.put("0;1", "收货人/发货人");
			scType.put("0;2", "收货人/通知人");
			scType.put("1;2", "发货人/通知人");
			scType.put("0;1;2", "收货人/发货人/通知人");
			p_map.put("scType", scType);
			// 运单类型
			HashMap<String, String> awType = new HashMap<>();
			awType.put("0", "主单");
			awType.put("1", "分单");
			awType.put("0;1", "主单/分单");
			p_map.put("awType", awType);
		} else if ("sita".equalsIgnoreCase(dictType)) {
			// 报文处理状态
			HashMap<String, String> status = new HashMap<>();
			status.put("0", "未处理");
			status.put("1", "已处理");
			p_map.put("status", status);
		}

		return p_map;
	}

}
